package com.qf.bbapi.controller;

import com.qf.bbapi.service.intf.SmsLogService;
import com.qf.bbapi.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/smsLog/")
@Api(tags = "短信服务")
@CrossOrigin
public class SmsLogController {
    @Resource
    private SmsLogService smsLogService;

    @GetMapping("phoneLogin.do")
    @ApiOperation(value = "手机号登录发送验证码")
    public R sendByPhone(String phone){
        return smsLogService.sendByPhone(phone);
    }

    @GetMapping("find.do")
    @ApiOperation(value = "密码找回发送验证码")
    public R sendByFind(String phone){
        return smsLogService.sendByFind(phone);
    }

    @GetMapping("regist.do")
    @ApiOperation(value = "用户注册发送验证码")
    public R sendByRegist(String phone){
        return smsLogService.sendByRegist(phone);
    }

}
